package com.esisa.utils;

import com.esisa.business.AdminManager;
import com.esisa.business.AuthentificationManager;
import com.esisa.business.DefaultAdminManager;
import com.esisa.business.DefaultAuthentificationManager;
import com.esisa.business.DefaultFermierManager;
import com.esisa.business.DefaultVeterinaireManager;
import com.esisa.business.FermierManager;
import com.esisa.business.VeterinaireManager;
import com.esisa.dao.BetailDao;
import com.esisa.dao.CompteDao;
import com.esisa.dao.CreteresVaccinantionDao;
import com.esisa.dao.FermierDao;
import com.esisa.dao.MaladieDao;
import com.esisa.dao.MedicamentDao;
import com.esisa.dao.RaceDao;
import com.esisa.dao.TypeBetailDao;
import com.esisa.dao.VaccinationCatalogueDao;
import com.esisa.dao.VeterinaireDao;
import com.esisa.dao.hibernate.BetailDaoHibernate;
import com.esisa.dao.hibernate.CompteDaoHibernate;
import com.esisa.dao.hibernate.CreteresVaccinantionDaoHibernate;
import com.esisa.dao.hibernate.FermierDaoHibernate;
import com.esisa.dao.hibernate.MaladieDaoHibernate;
import com.esisa.dao.hibernate.MedicamentDaoHibernate;
import com.esisa.dao.hibernate.RaceDaoHibernate;
import com.esisa.dao.hibernate.TypeBetailDaoHibernate;
import com.esisa.dao.hibernate.VaccinationCatalogueDaoHibernate;
import com.esisa.dao.hibernate.VeterinaireDaoHibernate;
import com.esisa.models.TypeBetail;
import com.esisa.models.VaccinationCatalogue;

public class BusinessFactory {
	private static AuthentificationManager authentificationManager;
	private static VeterinaireManager veterinaireManager;
	private static AdminManager adminManager;
	private static FermierManager fermierManager;
	static{
		CompteDao compteDao=new CompteDaoHibernate();
		VeterinaireDao veterinaireDao=new VeterinaireDaoHibernate();
		TypeBetailDao typeBetailDao=new TypeBetailDaoHibernate();
		FermierDao fermierDao=new FermierDaoHibernate();
		BetailDao betailDao=new BetailDaoHibernate();
		MaladieDao maladieDao=new MaladieDaoHibernate();
		MedicamentDao medicamentDao=new MedicamentDaoHibernate();
		RaceDao raceDao=new RaceDaoHibernate();
		VaccinationCatalogueDao vaccinationCatalogueDao=new VaccinationCatalogueDaoHibernate();
		CreteresVaccinantionDao creteresVaccinantionDao=new CreteresVaccinantionDaoHibernate();
		
		
		veterinaireManager=new DefaultVeterinaireManager();
		((DefaultVeterinaireManager)veterinaireManager).setCompteDao(compteDao);
		((DefaultVeterinaireManager)veterinaireManager).setVeterinaireDao(veterinaireDao);
		((DefaultVeterinaireManager)veterinaireManager).setMaladieDao(maladieDao);
		((DefaultVeterinaireManager)veterinaireManager).setMedicamentDao(medicamentDao);
		((DefaultVeterinaireManager)veterinaireManager).setRaceDao(raceDao);
		((DefaultVeterinaireManager)veterinaireManager).setVaccinationCatalogueDao(vaccinationCatalogueDao);
		((DefaultVeterinaireManager)veterinaireManager).setCreteresVaccinantionDao(creteresVaccinantionDao);
		
		adminManager=new DefaultAdminManager();
		((DefaultAdminManager)adminManager).setTypeBetailDao(typeBetailDao);
		((DefaultAdminManager)adminManager).setCompteDao(compteDao);
		
		fermierManager=new DefaultFermierManager();
		((DefaultFermierManager)fermierManager).setFermierDao(fermierDao);
		((DefaultFermierManager)fermierManager).setCompteDao(compteDao);
		((DefaultFermierManager)fermierManager).setBetailDao(betailDao);
		
		authentificationManager=new DefaultAuthentificationManager();
		((DefaultAuthentificationManager)authentificationManager).setCompteDao(compteDao);
		
	}
	public static AuthentificationManager getAuthentificationManager() {
		return authentificationManager;
	}
	public static VeterinaireManager getVeterinaireManager() {
		return veterinaireManager;
	}
	public static AdminManager getAdminManager() {
		return adminManager;
	}
	public static FermierManager getFermierManager() {
		return fermierManager;
	}
	
	
}	
